package ru.ognick.locale;

public class Translit {
	   private static String alpha = new String("абвгдеёжзиыйклмнопрстуфхцчшщьэюя");
	   private static String[] _alpha = {"a","b","v","g","d","e","yo","g","z","i","y","i",
	                              "k","l","m","n","o","p","r","s","t","u",
	                              "f","h","tz","ch","sh","sh","'","e","yu","ya"};
	   public static String r2e(String source) {
		   char[] chs = source.toLowerCase().toCharArray();
           StringBuffer buf = new StringBuffer("");
           for(int i=0; i<chs.length;i++){
               int k = alpha.indexOf(chs[i]);
               if(k != -1)
                   buf.append(_alpha[k]);
               else
                   buf.append(chs[i]);
           }
           return buf.toString();
	   }

}
